home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / getprofilestring.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.7 KB  |  60 lines

  1. <!---This example uses GetProfileString to set the 
  2.      timeout value in an initialization file. --->
  3.  
  4. <HTML>
  5. <HEAD>
  6. <TITLE>
  7. GetProfileString Example
  8. </TITLE>
  9. </HEAD>
  10.  
  11. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  12.  
  13. <BODY  bgcolor="#FFFFD5">
  14.  
  15. <H3>GetProfileString Example</H3>
  16.  
  17. This example uses GetProfileString to get the value of timeout in an initialization file. Enter the full path of your initialization file, specify the timeout value, and submit the form.
  18.  
  19. <!---  This section of code checks to see if the form was submitted.
  20.        If the form was submitted, this section gets the initialization
  21.        path and timeout value of the path and timeout value specified 
  22.        in the form                                                        --->
  23. <CFIF Isdefined("Form.Submit")>
  24.  
  25.     <CFSET IniPath = #form.iniPath#>
  26.  
  27.     <CFSET Section = "boot loader">
  28.  
  29.     <CFSET timeout = GetProfileString(IniPath, "boot loader", "timeout")>
  30.     
  31.     <CFSET default= GetProfileString(IniPath, "boot loader", "default")>
  32.     
  33.     
  34.     <H4>Boot Loader</H4>
  35.     <!--- If you do not have an entry in an initialization file, nothing 
  36.           will be displayed --->
  37.     
  38.     <P>Timeout is set to: <CFOUTPUT>#timeout#</CFOUTPUT>.</P>
  39.     <P>Default directory is: <CFOUTPUT>#default#</CFOUTPUT>.</P>
  40.             
  41. </CFIF>
  42.  
  43. <FORM ACTION="getprofilestring.cfm" METHOD="POST">
  44. <HR size="2" color="#0000A0">
  45. <table cellspacing="2" cellpadding="2" border="0">
  46. <tr>
  47.     <td>Full Path of Init File</td>
  48.     <td><input type="Text" name="IniPath" value="C:\myboot.ini"></td>
  49. </tr>
  50. <tr>
  51.     <td><input type="Submit" name="Submit" value="Submit"></td>
  52.     <td></td>
  53. </tr>
  54. </table>
  55.  
  56. </FORM>
  57. <HR size="2" color="#0000A0">
  58.  
  59. </BODY>
  60. </HTML>